//
//  PayOrderNet.m
//  beautyLamp
//
//  Created by Tam Kwok To Michael on 2017/10/10.
//  Copyright © 2017年 Tam Kwok To Michael. All rights reserved.
//

#import "PayOrderNet.h"
#import "BLHeader.h"
#import "BasicNetManager.h"
#import "BLOrder.h"
#import <YYModel.h>

@implementation PayOrderNet
#pragma mark 支付宝支付
+ (void)postPayInfo:(NSDictionary *)param completer:(void (^)(id result, NSError *error))completer {
    BasicNetManager *manager = [BasicNetManager share];
    [manager postURL:PAYORDER param:param completer:^(id result, NSError *error) {
        if (completer) {
            completer(result, error);
        }
    }];
    
}

#pragma mark 微信支付
+ (void)weChatPay:(NSString *)orderCode completer:(void (^)(id result, NSError *error))completer {
    BasicNetManager *manager = [BasicNetManager share];
    NSDictionary *param = @{@"orderCode":orderCode};
    [manager postURL:WECHATPAY param:param completer:^(id result, NSError *error) {
        if (completer) {
            completer(result, error);
        }
    }];
}

#pragma mark 修改订单状态
+ (void)updateOrder:(NSString *)orderId orderState:(NSString *)orderState completer:(void (^)(id result, NSError *error))completer{
    BasicNetManager *manager = [BasicNetManager share];
    NSDictionary *param = @{@"orderId" :orderId, @"orderState" :orderState};
    [manager postURL:UPDATEORDER param:param completer:^(id result, NSError *error) {
        if (completer) {
            BLOrder *order = [BLOrder yy_modelWithJSON:result];
            completer(order, error);
        }
    }];
}



@end
